package com.luych.toolbox.common.feign.view.data.service;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

@ApiModel("数据表")
public class TableView {

    @ApiModelProperty("名称")
    private String name;
    @ApiModelProperty("注释")
    private String comment;
    @ApiModelProperty("主键")
    private List<String> primaryKey;
    @ApiModelProperty("字段列表")
    private List<ColumnView> columns;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public List<String> getPrimaryKey() {
        return primaryKey;
    }

    public String getPrimaryKeyValue() {
        return primaryKey == null ? null : String.join(", ", primaryKey);
    }

    public void setPrimaryKey(List<String> primaryKey) {
        this.primaryKey = primaryKey;
    }

    public List<ColumnView> getColumns() {
        return columns;
    }

    public void setColumns(List<ColumnView> columns) {
        this.columns = columns;
    }
}
